import {Empty} from 'antd';
import Gun from '../GunCard'
import styles from './index.less';

export default function PileCard(props: any) {
    const {dispatch, curPile} = props;
    return (
        <div className={styles.pileCard}>
            <div className={styles.cardTitle}>
                <div>
                    <span> 桩编码: {curPile.pileCode}</span>
                </div>
            </div>
            <div className={styles.guns}>
                {curPile?.guns && curPile?.guns.length ? curPile?.guns.map((i: any) =>
                    <div key={i.id} className={curPile?.guns.length === 1 ? styles.oneGun : styles.twoGun}>
                        <Gun curGun={i} dispatch={dispatch}/>
                    </div>
                ) : <Empty/>}
            </div>
            <div/>
        </div>
    );
}
